import { getClassifyList } from '@/api/msbd.js'
import { getSave, deleteFn } from '@/api/classify.js';
export default {
    namespaced: true,
    state: {
        list: []
    },
    mutations: {
        setList(state, lists) {
            // console.log(lists);
            state.list = lists.data.resultes
        }
    },
    actions: {
        async getLists({ commit }) {
            const res = await getClassifyList()
            commit('setList', res.data)
            console.log(res);
        },
        async getSaves({ commit, dispatch }, val) {
            console.log(val);
            const res = await getSave(val)
            console.log(res);
            dispatch('getLists')
        },
        async removesFn({ commit, dispatch }, id) {
            await deleteFn(id)
            dispatch('getLists')
        }
    },
    getters: {}
}